// 广告相关API
import request from '@/utils/request'

// 获取Banner广告
export function getBannerAds() {
  return request({
    url: '/ad/ad/banner',
    method: 'GET'
  })
}

// 获取推荐广告
export function getRecommendAds() {
  return request({
    url: '/ad/ad/recommend',
    method: 'GET'
  })
}

// 获取指定位置广告
export function getAdsByPosition(positionCode) {
  return request({
    url: `/ad/ad/position/${positionCode}`,
    method: 'GET'
  })
}

// 记录广告点击
export function recordAdClick(adId) {
  return request({
    url: '/ad/ad/click',
    method: 'POST',
    data: { adId }
  })
}

// 记录广告展示
export function recordAdView(adId) {
  return request({
    url: '/ad/ad/view',
    method: 'POST',
    data: { adId }
  })
}